package day08_stream_file_charset.com.itheima.d3_recursion;

public class Test3_Recursion {
    public static void main(String[] args) {
        System.out.println(sum(5));
    }
    public static int sum(int n) {
        if (n == 1) {
            return 1;
        }else {
            return n + sum(n - 1);
        }
    }
}
